package edu.zqu.instructionalMatters.project.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigInteger;
import java.sql.Timestamp;

/**
 * @Author 何文东
 * @Date 2020-07-03
 * @Description: 课表 - 实体类
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("curriculum")
public class Curriculum implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private BigInteger id;

    /**
     * 学校id
     */
    @TableField("college_id")
    private BigInteger collegeId;

    /**
     * 学期id，关联到semester.id
     */
    @TableField("semester_id")
    private BigInteger semesterId;

    /**
     * 校历id，关联到calendar.id
     */
    @TableField("calendar_id")
    private BigInteger calendarId;

    /**
     * 校区id，关联到school.id
     */
    @TableField("school_id")
    private BigInteger schoolId;

    /**
     * 作息表id，关联到time_table.id
     */
    @TableField("time_table_id")
    private BigInteger timeTableId;

    /**
     * 授课班级id，关联到instruction_class.id
     */
    @TableField("instruction_class_id")
    private BigInteger instructionClassId;

    /**
     * 课程id，关联到course.id
     */
    @TableField("course_id")
    private BigInteger courseId;

    /**
     * 授课场地id，关联到field.id
     */
    @TableField("field_id")
    private BigInteger fieldId;

    /**
     * 教师id，关联到employee.id
     */
    @TableField("teacher_id")
    private BigInteger teacherId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Timestamp createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Timestamp updateTime;

    /**
     * 操作者
     */
    @TableField("by_who")
    private BigInteger byWho;

    /**
     * 本记录是否有效
     */
    @TableField("deleted")
    @TableLogic
    private Boolean deleted;

    /**
     * 历史版本
     */
    @TableField("last_version")
    private BigInteger lastVersion;
}
